package pe.edu.ulima.programacion.modulo5;

import javax.swing.JOptionPane;

/**
 *
 * @author profw51
 */
public class String2 {

    public static void main(String[] args) {
        String str1 = "Java";
        String str2 = "Java";
        String str3 = new String("Java");

        JOptionPane.showMessageDialog(null, str1 == str2); // true
        JOptionPane.showMessageDialog(null, str1 == str3); // false
        JOptionPane.showMessageDialog(null, str2 == str3); // false

        JOptionPane.showMessageDialog(null, str1.equals(str2));
        JOptionPane.showMessageDialog(null, str1.equals(str3));
        JOptionPane.showMessageDialog(null, str2.equals(str3));
    }
}
